﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace SmartLib.Dal.Sql
{
    internal static class SqlStringHelper
    {
        public static string ExpressionType2SqlString(ExpressionType type)
        {
            switch (type)
            {
                case ExpressionType.AndAlso:
                    return " And ";
                case ExpressionType.OrElse:
                    return " Or ";
                case ExpressionType.Equal:
                    return " = ";
                case ExpressionType.GreaterThan:
                    return " > ";
                case ExpressionType.GreaterThanOrEqual:
                    return " >= ";
                case ExpressionType.NotEqual:
                    return " <> ";
                case ExpressionType.LessThan:
                    return " < ";
                case ExpressionType.LessThanOrEqual:
                    return " <= ";
            }

            return string.Empty;
        }
    }
}
